const Model = require('../model/article/list');

module.exports = app => {

    return class AdminController extends app.Controller {
        async login() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }

        async index() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }

        async page() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }

        async search() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }

        async post() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }

        async about() {
            const { ctx, config } = this;
            const data = Object.assign(
                Model.getPage(1, 10),
                config.seo, {
                    controller: 'admin',
                    action: 'index',
                    title: 'test'
                });
            // console.log(data);
            await ctx.render('admin/index/index.js', data);
        }
    };
};
